import React, { lazy } from 'react'
import { RouteComponentProps } from 'react-router'
// 组件
const Home = lazy(() => import('../pages/Home'))
const ArticleList = lazy(() => import('../pages/ArticlePage/ArticleList'))

export interface IFRouteItem {
  path: string
  title: string
  component?: React.ComponentType<any>
  beforeEnter?: (
    props: RouteComponentProps,
    Com: React.ReactElement
  ) => React.ReactElement
  onAuthLogin?: boolean // 是否取消登录校验
}

// 静态路由
export const staticRoutes: IFRouteItem[] = [
  {
    path: '/app/home',
    title: '首页',
    component: Home
  },
  {
    path: '/app/article/list',
    title: '文章列表',
    component: ArticleList
  }
]
